package com.ek.distmpl.dao.mapper;

import com.ek.distmpl.dao.model.Vip;
import com.ek.distmpl.dao.model.VipExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface VipMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=VipSqlProvider.class, method="countByExample")
    long countByExample(VipExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @DeleteProvider(type=VipSqlProvider.class, method="deleteByExample")
    int deleteByExample(VipExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Delete({
        "delete from vip",
        "where vip_vid = #{vipVid,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String vipVid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Insert({
        "insert into vip (vip_vid, viptype, ",
        "is_forever, vpdays, vpmoney, ",
        "vip_status)",
        "values (#{vipVid,jdbcType=CHAR}, #{viptype,jdbcType=VARCHAR}, ",
        "#{isForever,jdbcType=BIT}, #{vpdays,jdbcType=INTEGER}, #{vpmoney,jdbcType=DOUBLE}, ",
        "#{vipStatus,jdbcType=INTEGER})"
    })
    int insert(Vip record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @InsertProvider(type=VipSqlProvider.class, method="insertSelective")
    int insertSelective(Vip record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @SelectProvider(type=VipSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="vip_vid", property="vipVid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="viptype", property="viptype", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_forever", property="isForever", jdbcType=JdbcType.BIT),
        @Result(column="vpdays", property="vpdays", jdbcType=JdbcType.INTEGER),
        @Result(column="vpmoney", property="vpmoney", jdbcType=JdbcType.DOUBLE),
        @Result(column="vip_status", property="vipStatus", jdbcType=JdbcType.INTEGER)
    })
    List<Vip> selectByExample(VipExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Select({
        "select",
        "vip_vid, viptype, is_forever, vpdays, vpmoney, vip_status",
        "from vip",
        "where vip_vid = #{vipVid,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="vip_vid", property="vipVid", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="viptype", property="viptype", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_forever", property="isForever", jdbcType=JdbcType.BIT),
        @Result(column="vpdays", property="vpdays", jdbcType=JdbcType.INTEGER),
        @Result(column="vpmoney", property="vpmoney", jdbcType=JdbcType.DOUBLE),
        @Result(column="vip_status", property="vipStatus", jdbcType=JdbcType.INTEGER)
    })
    Vip selectByPrimaryKey(String vipVid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=VipSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Vip record, @Param("example") VipExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=VipSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Vip record, @Param("example") VipExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @UpdateProvider(type=VipSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Vip record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table vip
     *
     * @mbg.generated Fri Mar 29 15:10:48 CST 2019
     */
    @Update({
        "update vip",
        "set viptype = #{viptype,jdbcType=VARCHAR},",
          "is_forever = #{isForever,jdbcType=BIT},",
          "vpdays = #{vpdays,jdbcType=INTEGER},",
          "vpmoney = #{vpmoney,jdbcType=DOUBLE},",
          "vip_status = #{vipStatus,jdbcType=INTEGER}",
        "where vip_vid = #{vipVid,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Vip record);
}